package com.example.demo.controller;

import cn.hutool.http.HttpUtil;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import reactor.core.publisher.Mono;

import java.util.HashMap;
import java.util.Map;

/**
 * test
 *
 * @author test
 */
@RestController
@RequestMapping("/root")
public class WebfluxTestController {
    @GetMapping("/hello")
    public String hello() {
        return "Hello, WebFlux !";
    }

    @GetMapping("/user")
    public Mono<Map<String, Object>> getUser() {
        Map<String, Object> map = new HashMap<>();
        map.put("username", "flux");
        map.put("password", "123456");
        return Mono.just(map);
    }
}
